package cn.itcast.feign.client;


import cn.itcast.feign.client.fallback.UserClientFallbackFactory;
import cn.itcast.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author llhuang10
 * @date 2021/8/21 8:54
 */
// configuration = FeignClientProperties.FeignClientConfiguration.class
// 局部配置, 所有的配置信息只针对user-service有效
// @FeignClient(value = "user-service", configuration = DefaultFeignClientConfiguration.class)
@FeignClient(value = "user-service", fallbackFactory = UserClientFallbackFactory.class)
public interface UserClient {

    @GetMapping("user/{id}")
    User findById(@PathVariable Long id);
}
